Adds white noise to each tonality. The len determines the noise pattern length. Amplitude controls the amount of randomisation and rnd-init initialises the random number seed. Try different size random noise lenghts. They appear in the results in interesting way. The effect is easily shown if you supply lots of same tonalities. Check out these.
1 makes random transpositions of the given tonality
(distort-tonality 1 1.5 0.2123
(activate-tonality
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)))
2 makes each 2 lines of the tonality to appear similarly transposed
(distort-tonality 2 1.5 0.2123
(activate-tonality
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)))
3 makes each 3 lines of the tonality to appear similarly transposed
(distort-tonality 3 1.5 0.2123
(activate-tonality
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)))
4 makes each tonality line similarly transposed (if each tonality has 4 notes).
(distort-tonality 3 1.5 0.2123
(activate-tonality
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)
(d min 1 3) (d min 1 3) (d min 1 3) (d min 1 3)))
5 ands a fifth note to each tonality, it is the root note randomized.